
package com.putao.tinytime.activities.menu;

import android.view.View;
import android.widget.ListView;
import android.widget.TextView;

import com.putao.tinytime.R;
import com.putao.tinytime.activities.menu.adapter.SampleItemInfoListAdapter;
import com.putao.tinytime.base.BaseFragment;
import com.putao.tinytime.bean.CollageConfigInfo;
import com.putao.tinytime.util.CollageInfoManager;

import java.util.ArrayList;

/**
 * Created by yanglun on 15/3/20.
 */
public class TinyTimeSampleListFragment extends BaseFragment
{
    private ListView body_lv;
    private TextView title_tv;

    @Override
    public int doGetContentViewId()
    {
        return R.layout.fragment_tiny_time_sample_list;
    }

    @Override
    public void doInitSubViews(View view)
    {
        super.doInitSubViews(view);
        title_tv = (TextView) view.findViewById(R.id.title_tv);
        body_lv = (ListView) view.findViewById(R.id.body_lv);
    }

    @Override
    public void doInitDataes()
    {
        title_tv.setText("小时光");
        CollageInfoManager mcollageInfoManager = CollageInfoManager.getInstance();
        ArrayList<CollageConfigInfo.SampleItemInfo> list = mcollageInfoManager.getCollageConfigInfo().data;
        SampleItemInfoListAdapter adapter = new SampleItemInfoListAdapter(mActivity);
        adapter.setCollageConfigInfoSampleItemInfoList(list);
        body_lv.setAdapter(adapter);
    }
}
